package com.wteam.dragon.model.pojo.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gitee.sunchenbin.mybatis.actable.annotation.*;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import com.wteam.dragon.system.basebean.bean.BaseBean;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @Author 陈晓辉
 * @Date 2020/4/10 9:56
 */
@Data
@Table
@TableName
@EqualsAndHashCode(callSuper = true)
public class Article extends BaseBean {
    @IsKey
    @IsNotNull
    @IsAutoIncrement
    @TableId(type = IdType.AUTO)
    @ColumnType(MySqlTypeConstant.BIGINT)
    @Column(comment = "自增id")
    private Long id;

    @IsNotNull
    @Column(comment = "类型id")
    @ColumnType(MySqlTypeConstant.BIGINT)
    private Long typeId;

    @IsNotNull
    @ColumnType(MySqlTypeConstant.VARCHAR)
    @Column(comment = "类型名称")
    private String typeName;

    @IsNotNull
    @ColumnType(MySqlTypeConstant.VARCHAR)
    @Column(comment = "文章标题")
    private String title;

    @IsNotNull
    @ColumnType(MySqlTypeConstant.TEXT)
    @Column(comment = "文章内容")
    private String content;

    @IsNotNull
    @DefaultValue("1")
    @ColumnType(MySqlTypeConstant.TINYINT)
    @Column(comment = "是否显示")
    private Boolean isShow;

    @IsNotNull
    @DefaultValue("999")
    @ColumnType(MySqlTypeConstant.INT)
    @Column(comment = "排序")
    private Integer sort;

    @IsNotNull
    @ColumnType(MySqlTypeConstant.VARCHAR)
    @Column(comment = "封面")
    private String cover;
}
